<template>
  <div class="index">
    <van-tabs v-model="active">
      <van-tab v-for="item in channels" :key="item.id" :title="item.name">
        <aritcle-list></aritcle-list>
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import { getChannels } from '@/api/channel'
import AritcleList from './aritcleList'
export default {
  name: 'home-index',
  components: {
    AritcleList
  },
  data () {
    return {
      active: 1,
      channels: []
    }
  },
  created () {
    this.loadChannel()
  },
  methods: {
    async loadChannel () {
      const res = await getChannels()
      console.log(res)
      this.channels = res.data.data.channels
    }
  }
}
</script>
<style lang="less" scoped>

</style>
